package com.example.demo.respository;

import com.example.demo.api.CarStation;
import com.example.demo.api.CarUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserRepository {

    @Select("select * from wx_account")
    public List<CarUser> findAll() ;

    @Select("select * from wx_account where id=#{PKcode}")
    public CarStation selectPk(String PKcode);



    @Select("select * from wx_account where openid=#{account}")
    public CarUser findById(String account);


    @Insert(
            { "insert into wx_account(openid,session_key)"
                    + "values(#{openid},#{session_key})" }
            )
    public boolean saveUser(String openid,String session_key);


}
